# 加解密
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '../../')))
import backend.DID.DID_interface as DID_interface
import backend.P2P.auth as auth
data=[ { "type": "text",
           "content": "你好，Bob！" ,
           "timestamp": "2025-07-10T10:30:00"}]

did="did:p2p_did_chat:p4XrPr8qaD"

info=auth.get_device_info()
encrypt=DID_interface.encrypt(info['cpu_id'],info['disk_id'],info['product_id'],data)

print(data)
print(encrypt)

decrypt=DID_interface.decrypt(info['cpu_id'],info['disk_id'],info['product_id'],encrypt)
print(decrypt)